package com.whk.exception;

import com.whk.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 异常处理类
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)//处理所有异常
    public Result exceptionResult(Exception e){
        e.printStackTrace();
        return Result.error("操作失败！");
    }
}
